<?php
/**
*
* @author Mihold (Mykhailo Kutsenko) miholdk@gmail.com
* @package umil
* @copyright (c) 2008 phpBB Group
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

/**
* @ignore
*/
define('UMIL_AUTO', true);
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup();

if (!file_exists($phpbb_root_path . 'umil/umil_auto.' . $phpEx))
{
	trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}

$mod_name = 'GOODPOST_MOD';

$version_config_name = 'mod_goodpost_version';
$language_file = 'mods/info_acp_goodpost';
$logo_img = "images/mod_goodpost/goodpost_logo.png";

$versions = array(
	// Version 1.0.0 [DEV]
	'0.1.4-dev'	=> array(
		// Craete configuration strings
		'config_add' => array(
			array('mod_goodpost_active', true),
			array('mod_goodpost_days_limit', 30),
			array('mod_goodpost_vote_max', 0),
			array('mod_goodpost_vote_min', 2),
		),
		// Craete voting table
		'table_add' => array(
			array($table_prefix . 'goodpost', array(
					'COLUMNS'		=> array(
						'post_id'		=> array('UINT', 0),
						'user_id'		=> array('UINT', 0),
						'vote_date'		=> array('TIMESTAMP', 0),
						'vote_val'		=> array('TINT:2', 0),
					),
					'PRIMARY_KEY'	=> array('post_id', 'user_id'),
				),
			),
		),
		// Add control module to the ACP
		'module_add' => array(
			// First, lets add a new category named ACP_CAT_GOODPOST_MOD to ACP_CAT_DOT_MODS
			array('acp', 'ACP_CAT_DOT_MODS', 'ACP_CAT_GOODPOST_MOD'),

			// Now we will add the settings and features modes from the acp_goodpost module to the ACP_CAT_GOODPOST_MOD category.
			array('acp', 'ACP_CAT_GOODPOST_MOD', array(
					'module_basename'	=> 'goodpost',
					'module_langname'	=> 'ACP_GOODPOST_CONFIG',
					'module_mode'		=> 'config',
					'module_auth'		=> 'acl_a_board',
				),
			),
		),
	),
	'0.1.5-dev'	=> array(
		// Craete configuration strings
		'config_add' => array(
			array('mod_goodpost_icon', 1),
			array('mod_goodpost_bg', 0),
			array('mod_goodpost_title', 0),
			array('mod_goodpost_line', 1),
		),
	),
);

// Include the UMIL Auto file and everything else will be handled automatically.
include($phpbb_root_path . 'umil/umil_auto.' . $phpEx);

?>